﻿mainModule.controller("tabularFilterCtrl", ["$scope", "$rootScope", "itemSvc", "notification", "pageState", "columnSvc", "$routeParams", "cache", "articleSvc", function ($scope, $rootScope, itemSvc, notification, pageState, columnSvc, $routeParams, cache, articleSvc) {
    var articleID = $routeParams.articleID;    
    $scope.query = { filters: [] };

    articleSvc.findById(articleID).then(function (response) {        
        $scope.query.filters = response.data.Columns;
    });

    
    $scope.search = function () {
        $scope.$emit('listReload', $scope.query);
    };
    $scope.cancel = function () {
        $scope.toggleFilter();
    };
}])